namespace TestEngine
{
    public class ClosedQuestionState : IQuestionState
    {
        public string Answer { get; private set; }
        public ClosedQuestion Question { get; private set; }

        public ClosedQuestionState(ClosedQuestion question, string answer)
        {
            Question = question;
            Answer = answer;
        }

        public double Score()
        {
            return Answer == Question.CorrectAnswer ? Question.Cost : 0;
        }

        public string[] GetAnswers()
        {
            return new[] {Answer};
        }
    }
}